//
//  CVGlobalDefine.h
//  ErShouChe
//
//  Created by haoyi on 14-5-5.
//  Copyright (c) 2014年 Hooy1. All rights reserved.
//


#import "AppDelegate.h"
#import "UIView+Toast.h"
#import "UIFont+UIFontHelper.h"
#import "IQKeyBoardManager.h"
#import "NSMutableArray+NSMutableArrayHelper.h"
#import "NSMutableDictionary+NSMutableDictionaryHelper.h"
#import "NSString+NSStringHelper.h"
#import "UIButton+UIButtonHelper.h"
#import "UIImageView+WebCache.h"
#import "UIButton+WebCache.h"
#import "JSONKit.h"

#ifndef __OPTIMIZE__
#define DLog(fmt, ...) NSLog((@"\n %s \n [Line %d] \n " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define DLog(...) {}
#endif

#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

//错误提示
#define d_Error_NetWork     @"服务器或网络错误,请稍后再试"
#define d_Error_TimeOut     @"连接超时"
#define d_Error_UnKnow      @"服务器或网络错误,请稍后再试"
#define d_Error_DataError   @"数据错误"

//当前ios版本
#define fIOSVersion_Current     [[[UIDevice currentDevice] systemVersion] floatValue]
//是否是ios7之后
#define bIsIOS7Later            !(fIOSVersion_Current < 7.0)
//是否是ios8之后
#define bIsIOS8Later            !(fIOSVersion_Current < 8.0)
//当前应用版本
#define strVersion_Current      [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey]
#define isPad               ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?\
CGSizeEqualToSize(CGSizeMake(320, 480),\
[[UIScreen mainScreen] currentMode].size) : \
NO)
//判断是否是iPhone4
#define bIsiPhone4              ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?\
CGSizeEqualToSize(CGSizeMake(640, 960),\
[[UIScreen mainScreen] currentMode].size) : \
NO)

//判断是否是iPhone5
#define bIsiPhone5              ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?\
CGSizeEqualToSize(CGSizeMake(640, 1136),\
[[UIScreen mainScreen] currentMode].size) : \
NO)
//判断是否是iPhone6
#define bIsiPhone6              ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?\
CGSizeEqualToSize(CGSizeMake(750, 1334),\
[[UIScreen mainScreen] currentMode].size) : \
NO)
//判断是否是iPhone6p
#define bIsiPhone6p              ([UIScreen instancesRespondToSelector:@selector(currentMode)] ?\
CGSizeEqualToSize(CGSizeMake(1242, 2208),\
[[UIScreen mainScreen] currentMode].size) : \
NO)

#define fHeight_StatueBar    20.0   //状态栏高度
#define fHeight_Nav    44.0   //导航条高度
#define fHeight_TabBar   49.0   //标签选择栏高度
#define cellcolor  [UIColor colorWithRed:0.16 green:0.19 blue:0.24 alpha:1.0]
#define fWidth_Current   ([[UIScreen mainScreen] bounds].size.width)
#define fHeight_Current  ([[UIScreen mainScreen] bounds].size.height)

//代理
#define APPDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
//用户字典
#define APPUserDict [NSUserDefaults standardUserDefaults]
//通知
#define APPUserNoti [NSNotificationCenter defaultCenter]
//数据中心
#define APPDataCenter [TGCDataCenter defaultCenter]

//内容字体
static const CGFloat    g_fSize_AppFont                 = 18.0;

static NSInteger const  g_iTag_Label                    = 20000000;
static NSInteger const  g_iTag_TextField                = 30000000;
static NSInteger const  g_iTag_Button                   = 40000000;

//默认图片
static NSString* const g_strImageName_Rectangle     = @"img_default_rectangle.png";
static NSString* const g_strImageName_Square        = @"img_default_square.png";



#define BACKGROUNDCOLOR [UIColor colorWithRed:241.0/255.0 green:241.0/255.0 blue:241.0/255.0 alpha:1.0]

////IOS应用下载地址
////static NSString* const g_strUrl_IOS = @"http://112.25.208.15:8085/tutu/down.html";
//static NSString* const g_strUrl_IOS = @"http://61.160.121.222:8080/tutu/down.html";


